wildcard characters

The asterisk (*), percent sign (%), question mark (?), underscore character (_), number sign (#), exclamation point (!), hyphen (-), and brackets ([ ]) are wildcard characters. You can use these characters in queries and expressions to include all records, file names, or other items that begin with specific characters or match a certain pattern. You can also use wildcard characters and matching characters to further refine a search when using an SQL statement.

Note The percent sign (%) and underscore character (_) wildcards are only used when using the Microsoft� OLE DB Provider for Jet. They are not exposed through DAO or the Microsoft Access UI. They will be treated as literal values in DAO or the Access UI.

Symbol Example Usage
* or % wh* finds what, white, and why

*at finds cat, bat, and what

Matches any number of characters, and can be used anywhere in the character string.
? or _ b?ll finds ball, bell, and bill Matches any single character.
# 1#3 finds 103, 113, 123 Matches any single digit.
[ ] b[ae]ll finds ball and bell but not bill Matches any single character within the brackets.
! b[!ae]ll finds bill and bull but not bell or ball Matches any character not in the list.
- b[a-c]d finds bad, bbd, and bcd Matches any one of a range of characters.


Note The wildcard characters * (asterisk), ? (question mark), # (number sign), and [ (opening bracket) can match themselves only if enclosed in brackets.